package homework02;

import java.util.Objects;

public class Dog extends Animal{
    @Override
    public String makeSound() {
        return "旺旺";
    }

    public Dog(String name) {
        super(name);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Dog)) return false;
        Dog dog = (Dog) o;
        return getName().equals(dog.getName());
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + getName() + '\'' +
                '}';
    }
}
